package cn.edu.scujcc;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/Order")
public class OrderController {
	
	@Autowired
	private OrderService service;
	
	@GetMapping
	public List<Order> getAllOrder(){
		List<Order> result = null;
		result = service.getAllOrder();
		return result;
	}
	@DeleteMapping("/{id}")
	public boolean deleteOrder(@PathVariable String id) {
		boolean result= false;
		result = service.deleteOrder(id);
		return result;
	}
	@PutMapping("/up/{id}")
	public Order getOrder(@PathVariable String id) {
		Order result= null;
		result = service.getOrder(id);
		return result;
	}
}
